\begin{evaltrace} +--> ;(++ 2 3) | | +--> ;2 {\it First argument evaluates to itself.} | | | +_-> ;2 | | +--> ;3 {\it Second argument evaluates to itself.} | | | +_-> ;3 | +**> ;Apply ++ to 2 and 3 {\it Apply the function to its arguments.} * +_*> ;5 \end{evaltrace}produces
Asterisks produce thick solid lines. Notice that the semi-colon and special + characters don't take up any space on output, so this affects the placement of the italicized comments in getting them to line up correctly.
\begin{evaltrace} +--> ;(double (++ 3 5)) | | +--> ;(++ 3 5) | | | +_-> ;8 | +**> ;Apply DOUBLE to 8 * ;create local variable N with value 8 * * +--> ;(* n 2) * | "n"-->"8" * | "2"-->"2" * +_-> ;16 +_*> ;Result of DOUBLE is 16 \end{evaltrace}results in
Here, another special character, the double-quote ("), is used to once again produce teletype output. Unlike, semi-colon, this each double-quote does take up one column of space. This is convenient in closure diagrams, as shown in a figure below.
The sequence +**>
produces an upper thick arrow with a thin
spur, T].
\begin{evaltrace} +--> ;(average 3 7) | +**> ;Apply AVERAGE to 3 and 7 * ;create local variable X with value 3 * ;create local variable Y with value 7 * * +--> ;(let ((sum ...)) ...) * | +--> ;(++ x y) * | | * | +_-> ;10 * +%%> ;Enter LET body * % ;create local variable SUM with value 10 * % * % +--> ;(list x y 'average (/ sum 2)) * % | "x"-->"3" * % | "y"-->"7" * % | "'average"-->"AVERAGE" * % | +--> ;(/ sum 2) * % | | "sum"-->"10" * % | +_-> ;5 * % +_-> ;(3 7 average 5) * +_%> ;(3 7 average 5) +_*> ;Result of AVERAGE is (3 7 AVERAGE 5) \end{evaltrace}produces
\begin{evaltrace} +--> ;(price-change 'widgets 1.25 1.35) | +**> ;Apply PRICE-CHANGE to WIDGETS, 1.25 and 1.35 * ;create local variable NAME with value WIDGETS * ;create local variable OLD with value 1.25 * ;create local variable NEW with value 1.35 * +--> ;(let ...) * | +--> ;(- new old) * | | "new"-->"1.35" * | | "old"-->"1.25" * | +_-> ;0.10 * | * | +--> ;(/ diff old) * | | A_]a->+_-> ;Error! DIFF unassigned variable. \end{evaltrace}results in
Here, in order to get the bottom arrows to run into each other, we use the raw et font character mappings.
\begin{evaltrace} +--> ;(price-change 'widgets 1.25 1.35) | +**> ;Apply PRICE-CHANGE to 1.25 and 1.35 * ;create local variable NAME with value WIDGETS * ;create local variable OLD with value 1.25 * ;create local variable NEW with value 1.35 * +--> ;(let* ...) * | +--> ;(- new old) * | | * | +_-> ;0.10 * +%%> ;Enter LET body * % ;create local variable DIFF with value 0.10 * % +--> ;(/ diff old) * % | * % +_-> ;0.08 * % +==> ;Enter LET body * % % ;create local variable PROPORTION with value 0.08 * % % +--> ;(* proportion 100.0) * % % | * % % +_-> ;8.0 * % % +==> ;Enter LET body * % % % ;create local variable PERCENTAGE with value 8.0 * % % % +--> ;(list name 'changed 'by percentage 'percent) * % % % | * % % % +_-> ;(WIDGETS CHANGED BY 8.0 PERCENT) * D=!D=!+_%> ;(WIDGETS CHANGED BY 8.0 PERCENT) +_*> ;Result of PRICE-CHANGE is (WIDGETS CHANGED BY 8.0 PERCENT) \end{evaltrace}produces
Again, notice the use of the et font.
\begin{evaltrace} +--> ;(zero-center '(3 11 13)) | +**> ;Apply ZERO-CENTER to (3 11 13) * ;create local variable DATA with value (3 11 13) * +--> ;(let ...) * | "(average data)"-->"9" * +%%> ;Enter LET body * % ;create local variable AVG with value 9 * % +--> ;(mapcar #'(lambda (x) (- x avg)) data) * % | +--> ;#'(lambda (x) (- x avg)) * % | | * % | +_-> ;#<Lexical-closure A> * % | "data"-->"(3 11 13)" * % +**> ;Apply MAPCAR to #<Lexical-closure A> and (3 11 13) * % * * % * +==> ;Apply #<Lexical-closure A> to 3 * % * % ;create local variable X with value 3 * %<----/ +--> ;(- x avg) * % * % | * % * % +_-> ;-6 * % * +_%> ;-6 * % * * % * +==> ;Apply #<Lexical-closure A> to 11 * % * % ;create local variable X with value 11 * %<----/ +--> ;(- x avg) * % * % | * % * % +_-> ;2 * % * +_%> ;2 * % * * % * +==> ;Apply #<Lexical-closure A> to 13 * % * % ;create local variable X with value 13 * %<----/ +--> ;(- x avg) * % * % | * % * % +_-> ;4 * % * +_%> ;4 * % +_*> ;Result of MAPCAR is (-6 2 4) * +_%> ;(-6 2 4) +_*> ;Result of ZERO-CENTER is (-6 2 4) \end{evaltrace}results in
Notice the use of the special connecting-line character.
\begin{evaltrace} +--> ;(zero-center '(3 11 13)) | +**> ;Apply ZERO-CENTER to (3 11 13) * ;create local variable DATA with value (3 11 13) * +--> ;(mapcar (shifter (average data)) data) * | +--> ;(shifter (average data)) * | | "(average data)"-->"9" * | +**> ;Apply SHIFTER to 9 * | * ;create local variable KONST with value 9 * | * +--> ;#'(lambda (x) (- x konst)) e..................' : * | * +_-> ;#<Lexical-closure A> v * | +_*> ;Result of SHIFTER is #<Lexical-closure A> q-----------w * | "data"-->"(3 11 13)" | | * +**> ;Apply MAPCAR to #<Lexical-closure A>, (3 11 13) |"KONST = 9"| * * | | * * +==> ;Apply #<Lexical-closure A> to 3 a-----------s * * % ;create local variable X with value 3 ^ * * % +--> ;(- x konst) | * * % | a---------------/ +_-> ;-6 ^ * * +_%> ;-6 | * * | * * +==> ;Apply #<Lexical-closure A> to 11 | * * % ;create local variable X with value 11 | * * % +--> ;(- x konst) a---------------/ | ^ * * % +_-> ;2 | * * +_%> ;2 | * * | * * +==> ;Apply #<Lexical-closure A> to 13 | * * % ;create local variable X with value 13 | * * % +--> ;(- x konst) a---------------/ | * * % +_-> ;4 * * +_%> ;4 * +_*> ;Result of MAPCAR is (-6 2 4) +_*> ;Result of ZERO-CENTER is (-6 2 4) \end{evaltrace}produces
\begin{evaltrace} ;{\it the global variable A has value FOO} \strut +--> ;(test 5) | +**> ;Apply TEST to 5 * ;create local variable A with value 5 * +..> ;(simple-incf a) * : +__> ;Apply macro SIMPLE-INCF to A * : * ;create local variable VAR with value A * : * +--> ;(print a) * : * | "a"-->"FOO" * : * | ;print FOO * : * +_-> ;FOO * : * +--> ;(list 'setq var (list '++ var 1)) * : * | * : * +_-> ;(SETQ A (++ A 1)) * : +_*> ;Result of macro expansion is (SETQ A (++ A 1)) * +.-> ;(setq a (++ a 1)) * | "(++ a 1)"-->"6" * | ;set local variable A to 6 * +_-> ;6 +_*> ;Result of TEST is 6 \end{evaltrace}results in